import request from '@/utils/request'

// 查询设备设施列表
export function list(query) {
  return request({
    url: '/risk/equipmentFacility/list',
    method: 'get',
    params: query
  })
}

// 查询设备设施详细
export function getById(id) {
  return request({
    url: '/risk/equipmentFacility/getById',
    method: 'get',
    params: { id }
  })
}

// 新增设备设施
export function add(data) {
  return request({
    url: '/risk/equipmentFacility/add',
    method: 'post',
    data: data
  })
}

// 修改设备设施
export function update(data) {
  return request({
    url: '/risk/equipmentFacility/update',
    method: 'put',
    data: data
  })
}





// 删除设备设施
export function del(id) {
  return request({
    url: '/risk/equipmentFacility/delete/'+id,
    method: 'delete'
  })
}

// 通过设备设施表id查询设备属性详细
export function getAttributesByFacilityId(facilityId) {
  return request({
    url: '/risk/equipmentFacility/getEquipmentAttributesList',
    method: 'get',
    params: { facilityId }
  })
}
// 查询设备属性详细
export function getAttributeById(id) {
  return request({
    url: '/risk/equipmentFacility/getAttributeById',
    method: 'get',
    params: { id }
  })
}